import { PlusOutlined, MinusOutlined } from "@ant-design/icons"
import { Button } from "antd";
import "./index.scss"

export default function CartItem({ goods, add, reduce }) {


    const handleGoodsPrices = (flag) => {

    }


    return <div className="goods">
        <div className="goodsImg">
            <img  src={goods.goods_img} alt="" />
        </div>
        <div className="right">
            <div className="goodsName">
                {goods.goods_name}
            </div>
            <div className="bottom">
                <div className="prices">
                    ￥<span>{goods.prices * goods.count}</span>
                </div>
                <div className="operation">
                    <Button icon={<PlusOutlined />} onClick={() => add(goods)}></Button>
                    <span className="count">{goods.count}</span>
                    <Button disabled={goods.count <= 1}  icon={<MinusOutlined />} onClick={() => reduce(goods.id)}></Button>
                </div>

            </div>
        </div>
    </div>
}